
class LinkNode:
    def __init__(self, value, next=None):
        self.value = value
        self.next = next


class MyLinkList:
    def __init__(self):
        self.head = None

    def add(self, value):
        """
        头部插入
        :param value:
        :return:
        """
        new_node = LinkNode(value)
        new_node.next = self.head
        self.head = new_node

    def append(self, value):
        """
        尾部插入
        :return:
        """
        if not self.head:
            new_node = LinkNode(value)
            return new_node
        else:
            char = self.head
            while char.next:
                char = char.next
            char.next = LinkNode(value)






